package com.xy.blog.article.domain.service;


import com.xy.blog.article.api.model.ArticleQuery;
import com.xy.blog.article.domain.exception.ArticleException;
import com.xy.blog.article.domain.service.model.ArticleBO;
import com.xy.blog.core.springmvc.result.page.PageReq;
import com.xy.blog.core.springmvc.result.page.PageResp;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author zanhonglei
 * @version V1.0
 * @Description:
 * @date 2019/10/30 23:09
 */
public interface IArticleService {


    /**
     * 博客首页
     * @param req
     * @return
     */
    PageResp<ArticleBO> blogHomeArticleList(PageReq<ArticleQuery> req) throws ArticleException;

    /**
     * 热点文章
     * @param req
     * @return
     */
    PageResp<ArticleBO> blogHomeHotrticleList(PageReq<ArticleQuery> req) throws ArticleException;

    /**
     * 获取分页文章数据
     * @param req
     * @return
     */
    PageResp<ArticleBO> listArticlesByPage(PageReq<ArticleQuery> req) throws ArticleException;

    /**
     * 根据文章id获取文章信息
     * @param id
     * @return
     */
    ArticleBO getArticleById(Long id) throws ArticleException;

    /**
     * 更新文章
     * @param articleBO
     */
    void updateArticle(ArticleBO articleBO) throws ArticleException;

    /**
     * 文章发布
     * @param articleBO
     */
    void add(ArticleBO articleBO) throws ArticleException;

    /**
     * 根据id删除文章
     * @param id
     */
    void deleteArticleById(Long id) throws ArticleException;

    /**
     * 文件上传
     * @param file
     * @return
     */
    String upload(MultipartFile file) throws ArticleException;

    /**
     * 文件下载
     * @param picId
     * @return
     */
    ResponseEntity<byte[]> download(Long picId) throws ArticleException;


    void like(Long id) throws ArticleException;

    void view(Long id) throws ArticleException;

    /**
     * 修改顺序
     * @param ordId
     * @param newId
     */
    void changeOrders(String ordId, String newId);

}
